using System;
using System.ServiceModel;

namespace Pegasus.ServiceModel
{
	/// <summary>
	/// This defines the service contract for private node to node operations.
	/// </summary>
	[ServiceContract( Name = "IPrivate", Namespace = "http://ServiceModel.Pegasus-Tech.Net" )]
	internal interface IPrivate
	{
		/// <summary>
		/// Sends the message.
		/// </summary>
		/// <param name="sender">The name of the node sending the message.</param>
		/// <param name="message">The message.</param>
		/// <returns>The return value.</returns>
		[OperationContract]
		object SendPrivateMessage( string sender, object message );

		/// <summary>
		/// Pings the specified node.
		/// </summary>
		/// <param name="sender">The name of the node sending the message.</param>
		/// <returns>True if the node is online, otherwise false.</returns>
		[OperationContract]
		bool Ping( string sender );

		/// <summary>
		/// Send a welcome to a new node in the mesh.  This message tells the new
		/// node who we are and gives our view of the mesh.
		/// </summary>
		/// <param name="sender">The name of the node sending the message.</param>
		/// <param name="nodeData">The node data.</param>
		[OperationContract( IsOneWay = true )]
		void SendWelcome( string sender, NodeData nodeData );

		/// <summary>
		/// Sends an answer to a WhoIs request.
		/// </summary>
		/// <param name="sender">The name of the node sending the message.</param>
		/// <param name="nodeData">The node data.</param>
		[OperationContract( IsOneWay = true )]
		void SendWhoIsAnswer( string sender, NodeData nodeData );
	}
}
